package com.scs.application.core.pdf.enums;

import lombok.Getter;

/**
 * @description: PDF 页面方向
 */
public enum PdfPageDirection {

    LONGITUDINAL("1", "纵向"),
    TRANSVERSE("0", "横向");


    @Getter
    private String code;

    @Getter
    private String desc;

    PdfPageDirection(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static PdfPageDirection of(String code) {
        switch (code) {
            case "1":
                return PdfPageDirection.LONGITUDINAL;
            case "0":
                return PdfPageDirection.TRANSVERSE;
            default:
                return PdfPageDirection.LONGITUDINAL;
        }
    }
}
